package com.macro.mall.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.PinionParam;
import com.macro.mall.model.SpsDataContent;
import com.macro.mall.service.SysDataManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("sys/dataManagement")
public class DataManagementController {


    @Autowired
    private SysDataManService dataManService;

    /***
     * 获取舆情研判列表
     */
    @GetMapping("getJudgment")
    public CommonResult getJudgment(PinionParam param){
        return dataManService.getJudgment(param);
    }

    /***
     * 手动研判
     * @param param
     * @return
     */
    @PutMapping("manualJudgment")
    public CommonResult manualJudgment(@RequestBody PinionParam param){
        SpsDataContent content = new SpsDataContent();
        content.setId(param.getId());
        content.setJudgeType(param.getJudgeType());
        return dataManService.edit(content);
    }


    /***
     * 批量删除作品表
     * @param id
     * @return
     */
    @DeleteMapping("/{id}")
    public CommonResult delete(@PathVariable(value = "id") String id){
        return dataManService.delete(id);
    }


    /***
     * 获取内容下的评论
     * @param param
     * @return
     */
    @GetMapping("getDiscuss")
    public CommonResult getDiscuss(PinionParam param){
        return dataManService.getDiscuss(param);
    }


    /***
     * 获取舆情话题
     * @return
     */
    @GetMapping("getOpinionTopic")
    public CommonResult getOpinionTopic(PinionParam param){
        return dataManService.getOpinionTopic(param);
    }


    /****
     * 查询舆情话题详情
     * @return
     */
    @GetMapping("getOpinionItem")
    public CommonResult getOpinionItem(PinionParam param){
        return dataManService.getOpinionItem(param);
    }


    /****
     * 查询平台数据
     * @return
     */
    @GetMapping("getPlatformData")
    public CommonResult getPlatformData(PinionParam param){
        return dataManService.getPlatformData(param);
    }


}
